{"componentChunkName":"component---node-modules-rocketseat-gatsby-theme-docs-core-src-templates-docs-query-js","path":"/code-style/CampaignCreationSkeletonNID-CCI","result":{"data":{"mdx":{"id":"f1a20a3b-2701-546f-b8d7-617c8adb84ec","excerpt":"CCI-01C: Generic Typographic Mistake Type Severity Location Code Style CampaignCreationSkeletonNID.sol:L234 Description: The referenced line contains a…","fields":{"slug":"/code-style/CampaignCreationSkeletonNID-CCI/"},"frontmatter":{"title":"CampaignCreationSkeletonNID Code Style Findings","description":"Contains all the findings that relate to code style on the contract codebase","image":null,"disableTableOfContents":null},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"CampaignCreationSkeletonNID Code Style Findings\",\n  \"description\": \"Contains all the findings that relate to code style on the contract codebase\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h2\", {\n    \"id\": \"span-idcci-01ccci-01c-generic-typographic-mistakespan\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#span-idcci-01ccci-01c-generic-typographic-mistakespan\",\n    \"aria-label\": \"span idcci 01ccci 01c generic typographic mistakespan permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), mdx(\"span\", {\n    id: \"CCI-01C\"\n  }, \"CCI-01C: Generic Typographic Mistake\")), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Type\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Severity\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Location\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/reports/evergon-labs-tmi-staking-protocol-674eaeb16dc0450018dd65fb/appendix/finding-types#code-style\"\n  }, \"Code Style\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"img\", {\n    parentName: \"td\",\n    \"className\": \"o-severity o-informational\",\n    \"src\": \"https://omniscia.io/report-assets/informational.png\"\n  })), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/evergonlabs/StakingProtocol/blob/dd3cd83a38dbea2dad34f7dc82c835f1793d5459/packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol#L234\"\n  }, \"CampaignCreationSkeletonNID.sol:L234\"))))), mdx(\"h3\", {\n    \"id\": \"description\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#description\",\n    \"aria-label\": \"description permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Description:\"), mdx(\"p\", null, \"The referenced line contains a typographical mistake (i.e. \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"private\"), \" variable without an underscore prefix) or generic documentational error (i.e. copy-paste) that should be corrected.\"), mdx(\"h3\", {\n    \"id\": \"example\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#example\",\n    \"aria-label\": \"example permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Example:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-sol\",\n    \"metastring\": \"title=packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol highlight={1} lineNumbers=true lineOffset=233\",\n    \"title\": \"packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol\",\n    \"highlight\": \"{1}\",\n    \"lineNumbers\": \"true\",\n    \"lineOffset\": \"233\"\n  }, \"address hanlderAddress = address(new CampaignAssetManager());\\n\")), mdx(\"h3\", {\n    \"id\": \"recommendation\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#recommendation\",\n    \"aria-label\": \"recommendation permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Recommendation:\"), mdx(\"p\", null, \"We advise this to be done so to enhance the legibility of the codebase.\"), mdx(\"h3\", {\n    \"id\": \"alleviation-b64b659786cf3c84bea52feb3a69f546ba3601f0\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#alleviation-b64b659786cf3c84bea52feb3a69f546ba3601f0\",\n    \"aria-label\": \"alleviation b64b659786cf3c84bea52feb3a69f546ba3601f0 permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Alleviation (b64b659786cf3c84bea52feb3a69f546ba3601f0):\"), mdx(\"p\", null, \"The typographic mistake has been corrected addressing this exhibit.\"), mdx(ViewDiffButton, {\n    repoUrl: \"https://github.com/evergonlabs/StakingProtocol\",\n    mainHash: \"dd3cd83a38dbea2dad34f7dc82c835f1793d5459\",\n    fixHash: \"b64b659786cf3c84bea52feb3a69f546ba3601f0\",\n    gitHubIssue: \"0\",\n    mdxType: \"ViewDiffButton\"\n  }), mdx(\"h2\", {\n    \"id\": \"span-idcci-02ccci-02c-inefficient-mapping-lookupsspan\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#span-idcci-02ccci-02c-inefficient-mapping-lookupsspan\",\n    \"aria-label\": \"span idcci 02ccci 02c inefficient mapping lookupsspan permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), mdx(\"span\", {\n    id: \"CCI-02C\"\n  }, \"CCI-02C: Inefficient \", mdx(\"inlineCode\", {\n    parentName: \"h2\"\n  }, \"mapping\"), \" Lookups\")), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Type\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Severity\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Location\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/reports/evergon-labs-tmi-staking-protocol-674eaeb16dc0450018dd65fb/appendix/finding-types#gas-optimization\"\n  }, \"Gas Optimization\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"img\", {\n    parentName: \"td\",\n    \"className\": \"o-severity o-informational\",\n    \"src\": \"https://omniscia.io/report-assets/informational.png\"\n  })), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/evergonlabs/StakingProtocol/blob/dd3cd83a38dbea2dad34f7dc82c835f1793d5459/packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol#L218\"\n  }, \"CampaignCreationSkeletonNID.sol:L218\"), \", \", mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/evergonlabs/StakingProtocol/blob/dd3cd83a38dbea2dad34f7dc82c835f1793d5459/packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol#L219\"\n  }, \"L219\"), \", \", mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/evergonlabs/StakingProtocol/blob/dd3cd83a38dbea2dad34f7dc82c835f1793d5459/packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol#L235\"\n  }, \"L235\"), \", \", mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/evergonlabs/StakingProtocol/blob/dd3cd83a38dbea2dad34f7dc82c835f1793d5459/packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol#L236\"\n  }, \"L236\"), \", \", mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"https://github.com/evergonlabs/StakingProtocol/blob/dd3cd83a38dbea2dad34f7dc82c835f1793d5459/packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol#L267\"\n  }, \"L267\"))))), mdx(\"h3\", {\n    \"id\": \"description-1\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#description-1\",\n    \"aria-label\": \"description 1 permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Description:\"), mdx(\"p\", null, \"The linked statements perform key-based lookup operations on \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"mapping\"), \" declarations from storage multiple times for the same key redundantly.\"), mdx(\"h3\", {\n    \"id\": \"example-1\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#example-1\",\n    \"aria-label\": \"example 1 permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Example:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-sol\",\n    \"metastring\": \"title=packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol highlight={2,3,19,20,51} lineNumbers=true lineOffset=216\",\n    \"title\": \"packages/contracts/contracts/skeletons/NID/CampaignCreationSkeletonNID.sol\",\n    \"highlight\": \"{2,3,19,20,51}\",\n    \"lineNumbers\": \"true\",\n    \"lineOffset\": \"216\"\n  }, \"// On creation\\ngeneralStorage.campaignsInfo[campaignId].state++;\\ngeneralStorage.campaignsInfo[campaignId].creator = msg.sender;\\n\\nCampaignCreationStorage.Layout storage campaignCreationStorage = CampaignCreationStorage.layout();\\n\\nbytes4[] memory requiredSelectors = campaignCreationStorage.requiredSelectors;\\n\\nuint256 totalLength = dataToExecute.length;\\nuint256 requiredLength = requiredSelectors.length;\\n\\nif (requiredLength + optionalSelectorsToExecute.length != totalLength || totalLength == 0) {\\n    revert InvalidCampaignCreationInput(requiredLength, optionalSelectorsToExecute.length, totalLength);\\n}\\n\\n// Deploy InputAssetKeeper for the campaign\\naddress keeperAddress = address(new CampaignAssetManager());\\naddress hanlderAddress = address(new CampaignAssetManager());\\ngeneralStorage.campaignsInfo[campaignId].inputAssetKeeper = keeperAddress;\\ngeneralStorage.campaignsInfo[campaignId].rewardAssetHandler = hanlderAddress;\\n\\nemit CampaignAssetManagersDeployed(campaignId, keeperAddress, hanlderAddress);\\n\\n// Execute setters\\nuint256 i;\\n\\nfor (i; i < requiredLength; i++) {\\n    bytes memory input = abi.encodeWithSelector(requiredSelectors[i], campaignId, dataToExecute[i]);\\n    (bool success, bytes memory returnData) = address(this).call(input);\\n    if (!success) {\\n        revert RequiredSetterExecutionFailed(campaignId, requiredSelectors[i], dataToExecute[i], returnData);\\n    }\\n}\\n\\nfor (i; i < totalLength; i++) {\\n    bytes4 selectorToExecute = optionalSelectorsToExecute[i - requiredLength];\\n\\n    if (!campaignCreationStorage.isOptionalSelectorSupported[selectorToExecute]) {\\n        revert UnsupportedOptionalSelector(selectorToExecute);\\n    }\\n\\n    bytes memory input = abi.encodeWithSelector(selectorToExecute, campaignId, dataToExecute[i]);\\n    (bool success, bytes memory returnData) = address(this).call(input);\\n\\n    if (!success) {\\n        revert OptionalSetterExecutionFailed(campaignId, selectorToExecute, dataToExecute[i], returnData);\\n    }\\n}\\n\\n// Created\\ngeneralStorage.campaignsInfo[campaignId].state++;\\n\")), mdx(\"h3\", {\n    \"id\": \"recommendation-1\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#recommendation-1\",\n    \"aria-label\": \"recommendation 1 permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Recommendation:\"), mdx(\"p\", null, \"As the lookups internally perform an expensive \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"keccak256\"), \" operation, we advise the lookups to be cached wherever possible to a single local declaration that either holds the value of the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"mapping\"), \" in case of primitive types or holds a \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"storage\"), \" pointer to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"struct\"), \" contained.\"), mdx(\"p\", null, \"As the compiler's optimizations may take care of these caching operations automatically at-times, we advise the optimization to be selectively applied, tested, and then fully adopted to ensure that the proposed caching model indeed leads to a reduction in gas costs.\"), mdx(\"h3\", {\n    \"id\": \"alleviation-b64b659786cf3c84bea52feb3a69f546ba3601f0-1\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#alleviation-b64b659786cf3c84bea52feb3a69f546ba3601f0-1\",\n    \"aria-label\": \"alleviation b64b659786cf3c84bea52feb3a69f546ba3601f0 1 permalink\",\n    \"className\": \"anchor before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Alleviation (b64b659786cf3c84bea52feb3a69f546ba3601f0):\"), mdx(\"p\", null, \"All referenced inefficient \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"mapping\"), \" lookups have been optimized to the greatest extent possible, significantly reducing the gas cost of the functions the statements were located in.\"), mdx(ViewDiffButton, {\n    repoUrl: \"https://github.com/evergonlabs/StakingProtocol\",\n    mainHash: \"dd3cd83a38dbea2dad34f7dc82c835f1793d5459\",\n    fixHash: \"b64b659786cf3c84bea52feb3a69f546ba3601f0\",\n    gitHubIssue: \"0\",\n    mdxType: \"ViewDiffButton\"\n  }));\n}\n;\nMDXContent.isMDXComponent = true;","headings":[{"depth":2,"value":"<span id=\"CCI-01C\">CCI-01C: Generic Typographic Mistake</span>"},{"depth":3,"value":"Description:"},{"depth":3,"value":"Example:"},{"depth":3,"value":"Recommendation:"},{"depth":3,"value":"Alleviation (b64b659786cf3c84bea52feb3a69f546ba3601f0):"},{"depth":2,"value":"<span id=\"CCI-02C\">CCI-02C: Inefficient mapping Lookups</span>"},{"depth":3,"value":"Description:"},{"depth":3,"value":"Example:"},{"depth":3,"value":"Recommendation:"},{"depth":3,"value":"Alleviation (b64b659786cf3c84bea52feb3a69f546ba3601f0):"}]}},"pageContext":{"slug":"/code-style/CampaignCreationSkeletonNID-CCI/","prev":{"label":"CampaignCreationSkeleton.sol (CCN-C)","link":"/code-style/CampaignCreationSkeleton-CCN"},"next":{"label":"CampaignCreationStorage.sol (CCS-C)","link":"/code-style/CampaignCreationStorage-CCS"}}},"staticQueryHashes":["1954253342","2328931024","2501019404","973074209"]}